<?php

$thisPage = "exhibition";

TemplateHelper::useLayout("exhibition");

function buildLayout(&$smarty) {
    global $subpage;
    initDatabase();
    Database::loadModel("exhibition");
    $exhibitiondata = Database::getModel()->getCurrentExhibition();
    Database::loadModel("exhibitors");
    $data = Database::getModel()->getExhibitors();
    for ($i = 0; $i < count($data); $i++) {
        $data[$i]['pavilionlink'] = "index.php?choice=virtualis_kiallitas&subpage=pavilion&company_id=" . $data[$i]['company_id'];
    }
    $smarty->assign("exhibitors", $data);
    $smarty->assign("startdate", $exhibitiondata['startdate']);
    $smarty->assign("enddate", $exhibitiondata['enddate']);
    $smarty->assign("title", $exhibitiondata['exhibition_name']);
}


function getPageHeader() {
    return TemplateHelper::getDefaultPageHeader();
}

function getPageFooter() {
    return TemplateHelper::getDefaultPageFooter();
}

function getContent($smarty) {
    global $thisPage;

    initDatabase();
    Database::loadModel("staticcontent");
    $content = Database::getModel()->getField("chambers");
    return array(
        content => $content,
        title => "Chambers of commerce",
    );
}

?>
